home *** CD-ROM | disk | FTP | other *** search
- Chapter 5
-
- The LOADHI Programs
-
- The two LOADHI programs, (LOADHI.COM and LOADHI.SYS) enable you
- to load TSRs, drivers, and DOS resources into available regions
- of high RAM. Your high memory is transformed into high RAM by
- QEMM386.SYS's RAM parameter. If you have run the Optimize program
- this has been done for you. Check your CONFIG.SYS file for the
- QEMM statement and be sure the RAM parameter is present. If not,
- refer to Chapter 3 page 16.
-
- This chapter explains how and when the LOADHI programs may be
- used and describes the command line switches available. These
- switches help you determine and modify the effectiveness of
- LOADHI in freeing up conventional memory. Freeing up this memory
- may enable you to:
-
- ~Item~ run programs that would not fit in memory before,
-
- ~Item~ add TSRs you have been doing without,
-
- ~Item~ speed up memory-starved programs that no longer need to go
- to disk for their data,
-
- ~Item~ add DOS resources to improve system response time and
- program effectiveness, and
-
- ~Item~ increase the memory available to applications running in
- DESQview.
-
- The LOADHI programs are very effective with or without
- customization by you. However, it is important to note that if
- LOADHI is unable to make use of high RAM for a particular program
- or a DOS resource, it will use conventional memory instead. Thus,
- your programs and DOS resources are available for use whether
- they were relocated or not.
-
- In order to use these two programs effectively, you need high
- RAM. In this chapter, it is assumed that QEMM has mapped
- available memory addresses with memory. If this is not the case,
- you may wish to install and set up QEMM as described in Chapter
- 2, Installation.
-
- ~Subhead~ Using LOADHI
-
- Both LOADHI.SYS and LOADHI.COM load programs into high RAM. You
- use LOADHI.SYS to load device drivers with an appropriate DEVICE=
- statement in your CONFIG.SYS file. You use LOADHI.COM to load
- programs either from COMMAND.COM'S command line or from within
- your AUTOEXEC.BAT file. Both LOADHI programs support the same set
- of command line options (switches) which let you alter the way
- LOADHI normally allocates and uses high RAM. These switches are
- described more fully on page 40, LOADHI Options.
-
- In addition, LOADHI.COM can be executed from the command line at
- any time to give you a listing of your current usage of high RAM.
- The following section describes this listing. It defines key
- terminology used in this chapter. And it is also the starting
- point for you, if and when you need to employ LOADHI's command
- line options.
-
- ~Subhead~ The LOADHI Report
-
- You display the LOADHI report by running LOADHI from the command
- line without specifying any command line option or program file
- to load:
-
- ~Step~ Type LOADHI and press <Enter>.
-
- The LOADHI report, shown below, describes what high RAM is in use
- and still available, the amount of high RAM used, and the names
- of the programs or DOS resources using the memory. It also shows
- you the memory address range in use by each block within a
- region.
-
- As described in Chapter 2, QEMM locates and maps high memory
- areas into high RAM. These memory areas may be scattered
- throughout the high memory area due to the presence of BIOS and
- system ROM and RAM memory already in use by peripheral adapters.
- Each contiguous area of memory converted into high RAM is
- referred to as a region. Each region is given a number. Memory is
- allocated from a region in blocks. These regions may vary in
- size. Each time you load something into high RAM, LOADHI
- allocates a block of memory from one of these regions. That block
- shows up in the list for that region and the region's available
- size and memory area is reduced accordingly.
-
-
- However often you call upon LOADHI to populate high RAM, there
- will never be more or less regions available on a particular
- configuration. The number of blocks listed for a given region
- will, however, increase as LOADHI uses this memory.
-
- If you display the LOADHI report before you have loaded TSRs or
- drivers in high RAM, you can see the number of regions found and
- mapped, the high memory address ranges, and the size of each
- region. Each region is marked as Available in the status column.
- This report serves as an excellent baseline for planning the best
- use of high RAM. The sum total of the regions' sizes gives you
- the upper limit to the conventional memory that can be saved by
- using LOADHI.
-
-
-
- ~Subhead~ LOADHI.SYS
-
- You use the LOADHI.SYS program when you want to load a device
- driver into high RAM. Device drivers are essentially extensions
- to DOS which DOS will load on system startup as it processes your
- CONFIG.SYS file.
-
- Any statement in your CONFIG.SYS file which begins with the
- keyword DEVICE= instructs DOS to load the device driver which is
- specified following that keyword. Some common devices are memory
- managers, add-on peripheral device drivers, such as a disk drive
- or a mouse, and extensions to existing devices, such as the
- ANSI.SYS driver supplied with DOS that some programs use to
- address the video display.
-
- With the exception of QEMM386.SYS, which LOADHI relies upon, any
- device driver that you currently use or anticipate using in the
- future is a candidate to consider loading into high RAM.
- Occasionally you may find a device driver that is sensitive to
- its location in memory and which will not work properly, if at
- all, when relocated. Other device drivers may require that you
- experiment with the customization capabilities of LOADHI.
- However, for the most part you will encounter little difficulty
- in using LOADHI.SYS with your device drivers.
-
- Since ANSI.SYS is available on every DOS system, we use it in the
- example below to show how you take advantage of LOADHI.SYS In
- this example, the sample CONFIG.SYS file has a statement which
- loads QEMM386.SYS, as well as the following statement loading
- ANSI.SYS:
-
- DEVICE=C:\DOS\ANSI.SYS
-
- This statement instructs DOS to load the file ANSI.SYS which can
- be found in the DOS subdirectory of disk drive C.
-
- To load ANSI.SYS in high memory, you must instruct DOS to load
- the file LOADHI.SYS instead of ANSI.SYS. LOADHI will take care of
- loading the ANSI.SYS file. You do this by modifying the
- CONFIG.SYS statement so that it reads:
-
- DEVICE=C:\QEMM\LOADHI.SYS C:\DOS\ANSI.SYS
-
- NOTE: Editing an existing DEVICE= statement simply displaces the
- device driver specification on the statement line. If the device
- driver you want to relocate takes command line switches of its
- own (the example ANSI.SYS has none), and you make use of any of
- these options, they should be retained in the edited statement
- also.
-
- This easy modification to your CONFIG.SYS file represents the
- simplest way to take advantage of LOADHI's features. For many
- systems, this will be adequate. When you need more control over
- the placement of device drivers or encounter difficulty in
- relocating a device driver, you should see the LOADHI switches
- section of this chapter.
-
- ~Subhead~ LOADHI.COM
-
- You use LOADHI.COM to load TSR (Terminate and Stay Resident)
- programs in high memory or to relocate DOS resources (such as
- disk buffers and file handles) into high memory. The TSRs you
- customarily use are probably found in your AUTOEXEC.BAT file. DOS
- resources are allocated, if at all, from your CONFIG.SYS file.
- Other TSRs which you use only occasionally may be loaded directly
- from the DOS prompt (or by way of a batch file).
-
- This section first explains how to use LOADHI.COM to load your
- TSRs into high RAM. It then briefly describes how you may use
- LOADHI.COM in conjunction with QEMM-386's programs (BUFFERS.COM,
- FILES.COM, etc.) that place DOS resources in high RAM. Since
- these programs also perform other functions, they are more fully
- described in Chapter 6, The DOS Resource Programs.
-
- In describing how to use LOADHI.COM, we use, as an example TSR, a
- program called DOITALL. This imaginary program resides in a disk
- directory called UTILS and has several command line options which
- modify its behavior. Our example shows two of these options: the
- /m option to force the program to display in monochrome and the
- /r option which instructs it to stay resident (it has a stand-
- alone mode) and available to be "popped up" on demand. To run
- DOITALL, the following statement needs to be executed:
-
- C:\UTILS\DOITALL /m /r
-
- This statement could be present in your AUTOEXEC.BAT file, in
- some other batch file you execute as needed, or a statement you
- enter from the DOS prompt whenever you want the program in
- memory. To run DOITALL out of high RAM, the above statement needs
- to be changed so that it executes LOADHI first:
-
- C:\QEMM\LOADHI C:\UTILS\DOITALL /m /r
-
- Notice that the statement that executed the program is now a
- parameter to the program LOADHI. All that we have done is insert
- the drive and directory path for LOADHI and made LOADHI the
- program to be loaded. LOADHI in turn loads and executes DOITALL
- in high RAM. DOITALL still sees its parameters when it
- initializes. In many cases this simple change to your system is
- sufficient to free up a significant amount of memory and still
- enjoy the benefits of your TSR programs.
-
- There are also several programs included with QEMM-386 which are
- meant to be used in conjunction with LOADHI.COM. These programs
- are BUFFERS.COM, FILES.COM, FCBS.COM and LASTDRIV.COM. As their
- names suggest, they allow you to allocate and use the associated
- DOS resources out of high RAM. If your CONFIG.SYS file is
- currently allocating any of these resources, the use of LOADHI
- and these utilities frees up much of the conventional memory now
- devoted to them.
-
- Each of these programs allocate memory before they terminate. If
- they are in high RAM, the memory they allocate comes from high
- RAM. Although these programs are fully described in the Chapter
- 6, The DOS Resource Programs, a typical example of the use of
- each one with LOADHI should give you an idea about their use.
- These examples do omit the details about the disk and
- subdirectory location of the programs.
-
- Example 1-Allocate buffers in high memory:
-
- Before LOADHI.COM:
- CONFIG.SYS file: BUFFERS=20
- AUTOEXEC.BAT file :
- After LOADHI.COM:
- CONFIG.SYS file: BUFFERS=1
- AUTOEXEC.BAT file: LOADHI BUFFERS=20
-
- Example 2-Add 10 file handles:
-
- Before LOADHI.COM:
- CONFIG.SYS file: FILES=20
- AUTOEXEC.BAT file:
- After LOADHI.COM:
- CONFIG.SYS file: FILES=10
- AUTOEXEC.BAT file: LOADHI FILES +10
-
- Example 3-Load FCBs in high memory:
-
- Before LOADHI.COM:
- CONFIG.SYS file: FCBS=8,2
- AUTOEXEC.BAT file:
- After LOADHI.COM:
- CONFIG.SYS file: FCBS=1,0
- AUTOEXEC.BAT file: LOADHI FCBS=8,2
-
- Example 4-Increase last drive to include drive letter G:
-
- Before LOADHI.COM:
- CONFIG.SYS file: LASTDRIVE=G
- AUTOEXEC.BAT file:
- After LOADHI.COM:
- CONFIG.SYS file: LASTDRIVE=D
- AUTOEXEC.BAT file: LASTDRIVE=G
-
- ~Subhead~ LOADHI Options
-
- There are several command line options for LOADHI which can help
- you make better use of your high RAM if you find that the simple,
- straightforward approach is inadequate.
-
- The command line options may help if you have trouble loading one
- or more of your programs into high RAM. Some command line options
- are to be used if you have more candidates for high RAM than seem
- to fit. Another command line option lets you specify a particular
- region to use or exclude. There is an option that will allow you
- to find out how much memory a program really needs, when that is
- not clear either from the program documentation, or from a
- estimate based on its file size.
-
- The LOADHI command line has the following format:
-
- LOADHI [loadhi-opts] target-program [target-program-opts]
-
- The brackets in the statement indicate that the item specified is
- optional. The target program represents the device driver or
- program you are loading. The last item shows the placement of
- options for the target program if there are any.
-
- Now that we know where LOADHI's options belong on the command
- line, we also need to know what an option looks like.
-
- ~Item~ A LOADHI option always begins with a slash (/).
-
- ~Item~ Following the slash is the option name, or its
- abbreviation.
-
- ~Item~ If the option can take a value, then the next character
- must be a colon (:) followed by the value.
-
- One LOADHI option is LARGEST, which optionally can take a value.
- You can indicate this option in any of the following ways:
-
- /LARGEST
- /L
- /LARGEST:2
- /L:2
-
- In all, there are thirteen options you may specify on a LOADHI
- command line, each of which are described below. Combinations of
- two or more options may be specified to give you greater control
- over the use of high RAM. These paragraphs show the full option
- name followed by its abbreviation. If a value is called for that
- is optional it is enclosed in square brackets ([ ]). The options
- are:
-
- ~Item~ /BESTFIT or /B instructs LOADHI to use the smallest block
- of memory in which the program fits. Using BESTFIT tends to
- reserve larger regions for your larger programs. See also SIZE
- and GETSIZE.
-
- ~Item~ /HAPPIEST or /H instructs LOADHI to use the smallest
- block of memory in which the program will fit, provided that it
- does not terminate with an error. Both device drivers and TSRs
- return after they are initialized, and the LOADHI programs can
- determine if the load was successful. It was not, then LOADHI
- will try again with a larger area until the program exits
- successfully. If necessary the program will be loaded in
- conventional memory.
-
- ~Item~ /REGION:n or /R:n instructs LOADHI to load the program
- into the region numbered "n".
-
- ~Item~ /LARGEST[:n] or /L[:n] instructs LOADHI to load the
- program into the largest block or one particular block out of
- several large blocks available. The number indicated by n
- indicates which of these to use. For instance the option /L:2
- specifies the second largest block.
-
- ~Item~ /SMALLEST[:n] or /S[:n] instructs LOADHI to load the
- program into the smallest block or one particular block out of
- several small blocks available. The number indicated by n
- indicates which of these to use. For instance the option /S:2
- specifies the second smallest block.
-
- ~Item~ /EXCLUDEREGION:n or /XR:n instructs LOADHI to not use
- region number n to load the target program.
-
- ~Item~ /EXCLUDELARGEST[:n] or /XL[:n] instructs LOADHI to not use
- the largest block (or the Nth largest block) to load the target
- program.
-
- ~Item~ /EXCLUDESMALLEST[:n] or /XS[:n] instructs LOADHI to not
- use the smallest block (or the Nth smallest block) to load the
- target program.
-
- ~Item~ /GETSIZE[:f] or /GS[:f] allows you to determine precisely
- the amount of memory a program requires. With this option LOADHI
- loads the program you specify and reports two memory usage
- values. The first value tells you how much memory (in bytes) the
- program required to load and initialize. The second value tells
- you the amount of memory the program has permanently retained for
- its own use. You use this option to help you custom fit your
- device drivers and TSRs into high RAM.
-
- The optional value f should be a file name. When a file name is
- present, LOADHI writes the program name and the two size values
- into this file so that you may examine it later. If the file name
- you specify already exists, LOADHI appends the information to
- this file. By systematically using the GETSIZE option with a file
- name you can compile the memory requirements of all the programs
- you wish to relocate to high RAM. This is the procedure that the
- Optimize program uses.
-
- NOTE to DESQview users: LOADHI /GETSIZE can be used to help you
- determine how much memory a program requires to run, so you can
- set an appropriate memory size. Simply run the program you are
- interested in a maximum memory window with LOADHI /GS. Do what
- you would normally do in the program. When you exit it, LOADHI
- displays the amount of memory that the program used. That number
- (increased slightly) can be used for the memory configuration for
- that program.
-
- ~Item~ /SIZE:nnnn or /SIZE:nnnnK instructs LOADHI to allocate
- from a block that will best fit the value nnnn. This number can
- be expressed in bytes (i.e 4096) or in kilobytes (i.e. 4K). The
- number you supply may come from the report issued by the GETSIZE
- option, or a number that you have determined by other means. In
- either case this number must represent the amount of memory the
- program needs to successfully initialize.
-
- ~Item~ /NOLO or /NL instructs LOADHI not to load the specified
- program at all if it will not fit in a high RAM region. This
- allows you to specify additional drivers, TSRs or DOS resources,
- that you would like to use, but only if they will be placed in
- high RAM.
-
- ~Item~ /LO instructs LOADHI to unconditionally use conventional
- memory instead of high RAM. You can use this option to
- temporarily change LOADHI statements in CONFIG.SYS or
- AUTOEXEC.BAT files without removing them completely.
-
- ~Item~ /TERMINATERESIDENT or /TSR instructs LOADHI to terminate
- as a TSR, leaving a small stub of code (about 100 bytes)
- resident. This option is only useful if you are using LOADHI in
- combination with DOS 4's INSTALL command in CONFIG.SYS. In this
- case, the effect of this option is simply to suppress an error
- message issued by DOS indicating a failure to load a TSR when in
- fact LOADHI successfully relocated the program.
-
- Finally, as a quick reminder, LOADHI will also respond to the
- following options on its command line:
-
- ~Item~ /NOPAUSEONERROR or NOPE instructs LOADHI not to pause on
- error.
-
- ~Item~ /PAUSE instructs LOADHI to pause while parsing commands.
-
- ~Item~ /HELP displays the LOADHI help screen.
-
- ~Item~ /? lists all LOADHI command switches.
-